def CalculateCRC(databytes):
    preset_value = 65535#0XFFFF
    polynomial = 33800#0X8408
    crcvalue = preset_value
    #databytes = databytes[2:]
    for i in databytes:
         crcvalue = crcvalue ^ i
         print "This is i: " + str(i)
         print "This is crcvalue: " + str(hex(crcvalue))
         for j in range(8):
              if (crcvalue & 1 == 1):
                   crcvalue = (crcvalue >> 1) ^ polynomial
                   print hex(crcvalue)
              else:
                   crcvalue = crcvalue >> 1
                   print hex(crcvalue)
    #crcvalue = ~ crcvalue - 65536
    #crclsb = crcvalue % 256
    #crcmsb = (crcvalue - crclsb) / 256
    crclsb = (crcvalue >> 8) & 0x00FF
    crcmsb = crcvalue & 0x00FF
    print "done"
    return hex(crclsb), hex(crcmsb)
